<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateAdminTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('admins', function (Blueprint $table) {
            $table->increments('id');
            $table->string('username', 20);
            $table->string('password');
            $table->unsignedTinyInteger('type')->comment('用户类型:0管理员1城市合伙人2运营3业务');
            $table->unsignedTinyInteger('status')->comment('状态0正常，1禁止登录');
            $table->unsignedInteger('target')->comment('对应表id');
            $table->string('logged_ip',15)->comment('最后一次登录ip');
            $table->timestamp('logged_at')->comment('最后一次登录时间');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('admins');
    }
}
